Description:
Via these keywords you can stop or start loops earlier. These keywords can be used in
LOOP, IF,
WHILE, REPEAT,
SELECT and FOR loops.
News:
From 0.16
NEXTIF and NEXTIFN keywords added
Syntax:
EXITIF <exp> [ DO <statements> ] [ ( IS / GIVES / GIVING / RETURNING ) <list> ]
While <exp> is FALSE nothing happens,
if TRUE, <statements> will be processed and
<list> of values will be returned.
You can also use EXITIFN keyword to negate the <exp>.
NEXTIF <exp> [ DO <statements> ]
While <exp> is FALSE nothing happens,
if TRUE, <statements> will be processed and
loop will continue from the beginning, that means, that the rest of code
between this NEXTIF and ENDWHILE/ENDLOOP/etc will be skipped and the loop
will continue.
You can also use NEXTIFN keyword to negate the <exp>.
EXIT keyword:
EXIT [ DO <statements> ] [ ( IS / GIVES / GIVING / RETURNING ) <list> ]
EXIT keyword is multiple-line equivalent for single-line IS keyword.
It is quite useless for loops (LOOP, WHILE, REPEAT, FOR), but it is
very useful for SELECT and IF statements. It allows you to return a
value from the statement. Watch returning values:
IF, SELECT.
Note: GIVES,
GIVING and RETURNING
keywords are all the same as
IS keyword, it is alloved only
to be more readable.